<%-- 
    Document   : index
    Created on : Sep 8, 2013, 2:29:59 AM
    Author     : Administrator
--%>

<%@page import="Controler.ChiTietDonHang"%>
<%@page import="java.util.List"%>
<%@page import="Model.Pojo.Chitietdondathang"%>
<%@page import="java.util.Set"%>
<%@page import="Model.Pojo.Dondathang"%>
<%@page import="Controler.CXuLy"%>
<%@page import="java.util.Date"%>
<%@page import="Model.Pojo.Khachhang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<head>
    <meta charset="utf-8" />
    <title>Chi tiết đơn đặt hàng</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="Mosaddek" name="author" />
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
    <link href="assets/bootstrap/css/bootstrap-fileupload.css" rel="stylesheet" />
    <link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    <link href="css/style-responsive.css" rel="stylesheet" />
    <link href="css/style-default.css" rel="stylesheet" id="style_color" />

    <link href="assets/fancybox/source/jquery.fancybox.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="assets/uniform/css/uniform.default.css" />

    <link rel="stylesheet" type="text/css" href="assets/chosen-bootstrap/chosen/chosen.css" />
    <link rel="stylesheet" type="text/css" href="assets/jquery-tags-input/jquery.tagsinput.css" />
    <link rel="stylesheet" type="text/css" href="assets/clockface/css/clockface.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-wysihtml5/bootstrap-wysihtml5.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/datepicker.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-timepicker/compiled/timepicker.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-colorpicker/css/colorpicker.css" />
    <link rel="stylesheet" href="assets/bootstrap-toggle-buttons/static/stylesheets/bootstrap-toggle-buttons.css" />
    <link rel="stylesheet" type="text/css" href="assets/bootstrap-daterangepicker/daterangepicker.css" />
    <style>

        h1, h2, h3, h4, h5, h6 {
            font-family: "MyriadPro-Light";
            font-weight: 900;
        }
    </style>
</head>
<body class="fixed-top">
    <jsp:include page="User Control/banner.jsp" flush="true"></jsp:include>

        <div id="container" class="row-fluid">
        <jsp:include page="User Control/menu.jsp" flush="true"></jsp:include>
            <div id="main-content">
                <div class="container-fluid">
                <jsp:include page="User Control/title.jsp" flush="true"></jsp:include>
                    <div class="row-fluid">

                        <!-- BEGIN FORM-->
                    <%

                        String error = (String) request.getAttribute(
                                "ERROR");
                        Object obj = request.getAttribute("QUAN_LY_DON_HANG");
                        if (obj == null)
                        {
                            error = "The page you request was not found.";
                        }
                        if (error == null && obj != null)
                        {
                            Dondathang dtoDDH = (Dondathang) request.getAttribute(
                                    "CHI_TIET_DON_HANG");
                    %>
                    <%
                        if (dtoDDH != null)
                        {

                    %>
                    <div>
                        <div class="span4">
                            <div class="widget green">
                                <div class="widget-title">
                                    <h4><i class="icon-info"></i>Thông tin đơn đặt hàng</h4>
                                </div>
                                <div class="widget-body" style="font-family: sans-serif">
                                    <h4>Mã đơn hàng: <span style="font-weight: 900"><i><%=dtoDDH.getMadonhang()%></i></span></h4>
                                    <h4>Mã khách hàng: <span style="font-weight: 900"><i>#<%=dtoDDH.getKhachhang().getMakh()%></i></span></h4>
                                    <h4>Số lượng CTĐH: <span style="font-weight: 900"><%=dtoDDH.getSoluongsanpham()%></span></h4>
                                    <h4>Tổng tiền: <span style="font-weight: 900; color: red"><%=CXuLy.FormatTienTe(dtoDDH.getTongtien(), "VNĐ")%></span></h4>
                                    <h4>Ngày đặt hàng: <span style="font-weight: 900; color: red"><%=CXuLy.ConvertDateToString(dtoDDH.getNgaythanhtoan())%></span></h4>
                                    <h4>Tình trạng giao hàng: <span style="font-weight: 900"><%
                                        if (dtoDDH.
                                                getTinhtrang() == true)
                                        {
                                            out.print(
                                                    "Đã giao hàng");
                                        }
                                        else
                                        {
                                            out.print(
                                                    "<a href='#'>Chưa giao hàng</a>");
                                        }

                                            %></span></h4>
                                </div>
                            </div>
                        </div>
                        <div class="span8">
                            <div class="widget green">
                                <div class="widget-title">
                                    <h4><i class="icon-dribbble"></i>Thông tin giao hàng</h4>
                                </div>
                                <div class="widget-body">
                                    <h4>Họ tên người nhận: <b style="font-size: 1.5em"><%=dtoDDH.getHoten()%></b></h4>
                                    <h4>Địa chỉ người nhận: <b style="font-size: 1.5em"><%=dtoDDH.getDiachigiaohang()%></b></h4>
                                    <h4>Số điện thoại người nhận: <b style="font-size: 1.5em"><%=dtoDDH.getSodienthoai()%></b></h4>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div>
                        <div class="span12">
                            <div class="widget green">
                                <div class="widget-title">
                                    <h4><i class="icon-double-angle-up"></i>Chi tiết sản phẩm</h4>
                                </div>
                                <div class="widget-body">
                                    <table class="table table-striped">
                                        <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Ảnh</th>
                                                <th>Mã SP</th>
                                                <th>Tên sản phẩm</th>
                                                <th>Số lượng</th>
                                                <th>Giá bán</th>
                                                <th>Tổng tiền</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <%
                                                Object[] lists = dtoDDH.
                                                        getChitietdondathangs().toArray();
                                                for (int i = 0;
                                                        i < lists.length; i++)
                                                {
                                                    Chitietdondathang dtoctddh = (Chitietdondathang) lists[i];
                                            %>
                                            <tr>
                                                <td><%=(i + 1)%></td>
                                                <td><img src="<%=dtoctddh.getSanpham().getAnhdaidein()%>" width="50" height="50"/></td>
                                                <td><%=dtoctddh.getSanpham().getMasp()%></td>
                                                <td><%=dtoctddh.getSanpham().getTensp()%></td>
                                                <td><%=dtoctddh.getSoluong()%></td>
                                                <td style="color: red"><%=CXuLy.
                                                        FormatTienTe(dtoctddh.getSanpham().
                                                        getGiaban(), "VNĐ")%></td>
                                                <td style="color: red"><%=CXuLy.FormatTienTe(dtoctddh.
                                                        getThanhtien(), "VNĐ")%></td>
                                            </tr>
                                            <%                                            }
                                            %>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div></div>
            </div>
            <%                                }
            else
            {
            %>
            <h1 style="color: red">The page you request was not found.</h1>
            <%                                    }
            %>
            <!-- END FORM-->
            <%                        }
            else
            {
            %>
            <h1 style="color: red"><%=error%></h1>
            <%                                            }
            %>
        </div>
        <!-- END VALIDATION STATES-->
    </div>

    <!--------------------------------footer--------------------------------------->
    <jsp:include page="User Control/footer.jsp" flush="true"></jsp:include>

    <!--------------------------------end footer--------------------------------------->

    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script type="text/javascript" src="assets/ckeditor/ckeditor.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="assets/bootstrap/js/bootstrap-fileupload.js"></script>
    <script src="js/jquery.blockui.js"></script>
    <!-- ie8 fixes -->
    <!--[if lt IE 9]>
    <script src="js/excanvas.js"></script>
    <script src="js/respond.js"></script>
    <![endif]-->
    <script type="text/javascript" src="assets/bootstrap-toggle-buttons/static/js/jquery.toggle.buttons.js"></script>
    <script type="text/javascript" src="assets/chosen-bootstrap/chosen/chosen.jquery.min.js"></script>
    <script type="text/javascript" src="assets/uniform/jquery.uniform.min.js"></script>
    <script type="text/javascript" src="assets/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script>
    <script type="text/javascript" src="assets/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script>
    <script type="text/javascript" src="assets/clockface/js/clockface.js"></script>
    <script type="text/javascript" src="assets/jquery-tags-input/jquery.tagsinput.min.js"></script>
    <script type="text/javascript" src="assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-daterangepicker/date.js"></script>
    <script type="text/javascript" src="assets/bootstrap-daterangepicker/daterangepicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
    <script type="text/javascript" src="assets/bootstrap-inputmask/bootstrap-inputmask.min.js"></script>
    <script src="assets/fancybox/source/jquery.fancybox.pack.js"></script>


    <!--common script for all pages-->
    <script src="js/common-scripts.js"></script>

    <!--script for this page-->
    <script src="js/form-component.js"></script>
</body>
</html>